package com.dp.Observer.principle.server.impl;

import com.dp.Observer.principle.server.Subject;
import com.dp.Observer.principle.server.Observer;

public class Observer1 implements Observer {
    private Subject subject;

    public Observer1(Subject subject) {
        this.subject = subject;
        subject.registerObserver(this);
    }

    @Override
    public void update(String msg) {
        System.out.println("observer1 得到 3D 号码  -->" + msg + ", 我要记下来。");
    }
}
